Profiling: check how long it takes to run a Python script
From Python’s official documentation: “A profile is a set of statistics that describes how often and for how long various parts of the program executed.”
From Python’s official documentation: “A profile is a set of statistics that describes how often and for how long various parts of the program executed.”
Problem: create a map of the letters and indices in a string.
My first approach was to loop over the string using range(len(s)), and checking if the letter exists in the map before adding it: